<?php $this->_extends('_layouts/main_layout'); ?>
<?php $this->_block('title'); ?>
<?php echo "Admins"; ?>
<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>
<div id="content" class="box">
	<h1>Users</h1>
	<div id="menu" class="box">
		<ul class="box">
			<li><a href="<?php echo url('user/add');?>"><span>Add</span></a></li>
		</ul>
	</div>
		<?php if (isset($infos)) 
				{
					foreach ($infos as $info)
					{
		?>
				<p class="msg info"><?php echo $info;?></p>
		<?php		}
				}
		?>
	<table class="full-size">
		<tbody>
			<tr>
				<th>Name</th>
				<th>Email</th>
				<th>Phone</th>
				<th>Actions</th>
			</tr>
			<?php
				$bg = false;
				foreach ($users as $user)
				{
			?>
			<tr <?php if ($bg) echo 'class="bg"';?>>
				<td><?php echo $user['name'];?></td>
				<td><?php echo $user['email'];?></td>
				<td><?php echo $user['phone'];?></td>
				<td>
				<a href="<?php echo url('user/edit', array('id'=>$user['id']));?>">Edit</a>
				<a href="<?php echo url('user/deleteconfirm', array('id'=>$user['id']));?>">Delete</a>
				</td>
			</tr>
			<?php
					$bg = !$bg;
				}
			?>
		</tbody>
	</table>
</div>
<?php $this->_endblock(); ?>